<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
    <title>投票列表</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.servletContext.contextPath}/css/style.css" />
    <link type="text/css" rel="stylesheet" href="${pageContext.servletContext.contextPath}/css/index.css" />
    <script src="${pageContext.servletContext.contextPath}/webjars/jquery/3.4.1/jquery.js"></script>
    <script src="${pageContext.servletContext.contextPath}/js/index.js"></script>
</head>
<body>
<%@include file="top.jsp"%>
<div id="vote" class="wrap">
    <h2>投票列表</h2>
    <ul class="list">
    <c:forEach items="${subjectPages.records}" var="sub" varStatus="i">
        <li   <c:if test="${i.index%2==0}">class="odd"</c:if>>
            <h4>
                <a href="">${sub.vsTitle}</a>
            </h4>
            <c:set var="isItem" value="false"></c:set>
            <c:forEach items="${sub.items}" var="child">
                <c:if test="${child.vuUserId==userinfo.vuUserId}">
                    <c:set var="isItem" value="true"></c:set>
                </c:if>
            </c:forEach>
          <c:if test="${!isItem}">
            <div class="join"><a href="Vote.action?entityId=<s:property value='id'/>">我要参与</a></div>
          </c:if> <p class="info">共有 ${fn:length(sub.options)}个选项，已有 ${fn:length(sub.items)}个网友参与了投票。</p>
        </li>
    </c:forEach>
    </ul>
    <div class="pagetools">
        <div class="pagesizeItem">
            <div class="cbopagesize">
                <select name="cbopagesize" >

                    <option value="4"   <c:if test="${pagesize==4}">selected</c:if>>4</option>
                    <option value="8"   <c:if test="${pagesize==8}">selected</c:if>>8</option>
                    <option value="12"   <c:if test="${pagesize==12}">selected</c:if>>12</option>
                </select>
            </div>
        </div>
        <div class="pageFirstItem">
            <div class="pageFirst">
              <span class="icon btniconFrist"></span>
              <span class="icon btniconPrve"></span>
            </div>
        </div>
        <div class="pageContentItem">
            <div class="">
                第<input type="text" name="pageindex" style="width: 40px;" value=" ${subjectPages.current}"> 页，共<span name="pages" tag="${subjectPages.pages}"> ${subjectPages.pages}</span>页，总记录数： ${subjectPages.total}
            </div>
        </div>
        <div class="pageLastItem">
            <div class="pageFirst">
                <span class="icon btniconNext"></span>
                <span class="icon btniconLast"></span>
            </div>
        </div>
        <div class="pageFalushItem">
            <div class="">
                <span class="icon btniconFalush"></span>
            </div>
        </div>
    </div>
</div>
<div id="footer" class="wrap">
    北大青鸟 &copy; 版权所有
</div>
</body>
</html>
